Align flash_response_index labels with filtered FRI coordinate order#18
Merged
lappalainenj merged 3 commits intomainfrom Feb 27, 2026
Merged
Conversation
Co-authored-by: lappalainenj <34949352+lappalainenj@users.noreply.github.com>
Co-authored-by: lappalainenj <34949352+lappalainenj@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix data-label misalignment in flash_response_index() method
Align Feb 27, 2026
flash_response_index labels with filtered FRI coordinate order
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a data-label misalignment bug in EnsembleView.flash_response_index() that occurred when filtering by cell types. The issue arose because xarray's custom.where() returns data in alphabetical coordinate order, but the original user-provided cell_types list was passed as labels, causing mismatched violin plots when the orders differed.
Changes:
- Fixed
EnsembleView.flash_response_index()to use filtered coordinate order for labels while preserving caller-defined display order - Added regression test to validate the fix
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| flyvis/network/ensemble_view.py | Fixed data-label alignment by extracting actual coordinate order after filtering and passing original order as sorted_type_list |
| tests/test_ensemble_view.py | Added unit test that reproduces the bug scenario and validates both label alignment and display order preservation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lappalainenj
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EnsembleView.flash_response_index()could pass user-requestedcell_typesas labels while plotting FRI values in xarray’s filtered coordinate order, causing mislabeled violins when the two orders differed. This change keeps data-label mapping consistent and still preserves caller-defined display ordering.Behavioral fix in
EnsembleView.flash_response_indexcell_typesis provided, the method now usesfris.cell_type.values(post-filter coordinate order) as the label array passed toplot_fris.sorted_type_list(unless already provided) so display sorting can still follow caller intent.Regression coverage
tests/test_ensemble_view.pythat reproduces a mismatched requested-vs-filtered order and asserts:sorted_type_listOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.